<!DOCTYPE html>
<html>

<head>
    <meta charset="utf-8">
    <!-- 避免使用IE冲突 -->
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>
    <!-- 360切换到极速内核 -->
    <meta name="renderer" content="webkit">
    <!-- 手机搜索转码 -->
    <meta http-equiv="Cache-Control" content="no-siteapp"/>
    <title>金三“并库”已上线，税务稽查全面开启 - 财税帮</title>
    <link rel="stylesheet" href="static/css/layui.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/common.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/class-pro.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/font_333802_ypr9k5jwbv.css"/>
    <link rel="stylesheet" href="static/css/iconfont.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/courserecommed.css" type="text/css"/>
    <link rel="stylesheet" href="static/css/jquery-page.css" type="text/css"/>
    <link rel="shortcut icon" href="static/images/logo.jpg" type="image/x-icon"/>
    <link rel="stylesheet" href="static/css/aliplayer-min.css"/>
    <script type="text/javascript" src="static/js/vue.js"></script>
    <script type="text/javascript" src="static/js/axios.min.js"></script>
    <style type="text/css">
        .coupon-model {
            display: none;
            z-index: 13000;
        }

        .coupon-model .coupon-box {
            min-height: 330px;
            width: 540px;
            margin: 20px auto;
            border: 1px solid #d9d9d9;
            padding: 0 35px 20px;
            background-color: #FFFFFF;
            border-radius: 5px;
            position: fixed;
            top: 45%;
            left: 50%;
            margin-top: -180px;
            margin-left: -306px;
            z-index: 13000;
            padding-top: 20px;
        }

        .coupon-model .coupon-box .coupon-header {
            height: 0px;
        }

        .coupon-model .coupon-box .coupon-header .close-btn {
            background: url(static/images/close-icon.png) no-repeat;
            width: 11px;
            height: 11px;
            cursor: pointer;
            position: absolute;
            right: 14px;
            top: 12px;
            text-indent: -999px;
        }

        .coupon-model .coupon-box .coupon-content .coupon-type-nav ul {
            height: 40px;
            float: left;
        }

        .coupon-model .coupon-box .coupon-content .coupon-type-nav li {
            border-bottom: 2px solid #fff;
            color: #666;
            font-size: 16px;
            float: left;
            margin-right: 20px;
            line-height: 38px;
            float: left;
        }

        .coupon-model .coupon-box .coupon-content .coupon-type-nav li.curr {
            border-color: #2DAADD;
            color: #333;
        }

        .coupon-model .coupon-box .coupon-content .coupon-type-nav a {
            float: right;
            color: #F69532;
            margin-top: 20px;
        }

        .coupon-model .coupon-box .coupon-content .coupon-type-nav a:hover {
            color: #CC7C29;
        }

        .coupon-model .coupon-box .coupon-content .coupon-tab {
            padding: 10px 0 20px 0;
        }

        .coupon-model .coupon-box .coupon-content .coupon-tab table {
            width: 540px;
            border-collapse: collapse;
        }

        .coupon-model .coupon-box .coupon-content .coupon-tab th {
            border: 1px solid #ccc;
            font-size: 14px;
            font-weight: normal;
            line-height: 42px;
            background: #DEDEDE;
        }

        .coupon-model .coupon-box .coupon-content .coupon-tab td {
            border: 1px solid #ccc;
            text-align: center;
            line-height: 40px;
            font-size: 12px;
        }

        .experience-course-model {
            display: none;
            z-index: 2000;
        }

        .experience-course-box {
            height: 230px;
            width: 350px;
            margin: 20px auto;
            border: 1px solid #d9d9d9;
            padding: 0 40px 30px;
            background-color: #FFFFFF;
            border-radius: 5px;
            position: fixed;
            top: 56%;
            left: 50%;
            margin-left: -191px;
            margin-top: -221px;
            z-index: 1025;
            padding-top: 30px;
        }

        .experience-course-box .experience-course-bar {
            height: 5px;
        }

        .experience-course-box .experience-course-bar .close-btn {
            background: url(static/images/close-icon.png) no-repeat;
            width: 11px;
            height: 11px;
            cursor: pointer;
            position: absolute;
            right: 14px;
            top: 12px;
            text-indent: -999px;
        }

        .experience-course-box .experience-course-code .code-title {
            text-align: center;
            font-size: 24px;
            height: 40px;
            line-height: 40px;
            color: #666;
            margin-bottom: 25px;
        }

        .experience-course-box .experience-course-code .code-group {
            width: 150px;
            margin: 0 auto;
            height: 60px;
        }

        .experience-course-box .experience-course-code .code-group input {
            display: inline;
            height: auto;
            width: 70px;
            padding: 5px 0;
            margin-left: -5px;
            background: none;
            border: none;
            border-bottom-width: medium;
            border-bottom-style: none;
            border-bottom-color: currentcolor;
            border-bottom: 1px solid #c1c1c1;
            text-align: center;
            font-size: 14px;
            color: #333;
        }

        .experience-course-box .experience-course-code .code-group .error-tips {
            margin-top: 10px;
            color: #fe0000;
            font-size: 12px;
            text-align: center;
        }

        .experience-course-box .experience-course-code .open-course {
            width: 182px;
            margin: 25px auto 0;
        }

        .experience-course-box .experience-course-code .open-course .open-btn {
            display: block;
            width: 180px;
            height: 40px;
            line-height: 38px;
            font-size: 18px;
            background: none;
            text-align: center;
            border-radius: 2px;
            color: #ff7745;
            border: 1px solid #ff7745;
        }

        .experience-course-box .experience-course-code .open-course .open-btn:hover {
            color: #EC561B;
            border: 1px solid #EC561B;
        }

        .experience-course-box .experience-course-code .no-code {
            margin-top: 20px;
            text-align: center;
        }

        .experience-course-box .experience-course-code .no-code .go-open-fee {
            color: #ff7745;
        }

        .experience-course-box .experience-course-code .no-code .go-open-fee:hover {
            text-decoration: underline;
            cursor: pointer;
            color: #EC561B;
        }

        .coupon-tab a {
            width: 120px;
            line-height: 36px;
            background: #2DAADD;
            border-radius: 6px;
            height: 36px;
            display: block;
            text-align: center;
            color: #fff;
            float: right;
            clear: both;
            margin: 55px 0px 0px 0px;
        }

        .coupon-tab-notice {
            width: 400px;
            line-height: 1.6em;
            margin-top: -10px;
        }

        .coupon-tab-notice span {
            font-weight: 700;
            color: #333;
            display: block;
            margin-bottom: 5px;
        }

        .coupon-tab-notice p {
            color: #555;
            margin-bottom: 5px;
        }

        .coupon-tab-tips {
            color: #db0000;
            font-size: 12px;
        }

        .coupon-tab-tips span {
            padding: 0 5px;
        }
    </style>
    <link rel="stylesheet" href="https://unpkg.com/element-ui/lib/theme-chalk/index.css">
    <!-- 引入组件库 -->
    <script src="https://unpkg.com/element-ui/lib/index.js"></script>
    <style>
        .el-carousel__container{
            height: 420px;
        }
        .regisers{
            color: #2b9dff;
        }
        .regisers:hover{
            cursor: pointer;
            color: #155bff;
        }
        .el-menu--horizontal>.el-submenu.is-active .el-submenu__title{
            border: none;
            height: 80px;
            line-height: 80px;
        }
        .el-menu.el-menu--horizontal{
            border:none;
        }
        .tab{
            width: 80px;
            height: 40px;
            background-color: #F3F5F7;
            float: left;
            margin-right: 10px;
            margin-bottom: 10px;
            text-align: center;
            line-height: 40px;
            font-size: 14px;
            color: #8D8D8D;
        }
    </style>
</head>

<body>
<!-------------头部-------------->
<div id="app">
    <!------------------------顶部导航----------------------------------->
    <div class="header">
        <div class="header-box">
            <a href="#" class="logo"><img src="static/images/logo.jpg" width="119" height="70" alt="叮叮财税">
                <span> <img src="static/images/title.png"></span>
            </a>
            <ul id="header-nav">
                <li id="index"><a href="index.html">首页</a></li>
                <li id="course"><a href="study.html">课程</a></li>
                <li id="news"><a href="consult.html">资讯</a></li>
                <li id="download"><a href="download.html">下载</a></li>
                <li id="service"><a href="service.html">服务</a></li>
            </ul>
            <div class="login rt" id="user-info">
                <el-menu class="el-menu-demo" mode="horizontal" v-if="userPhone">
                    <el-submenu index="1">
                        <template slot="title">{{userPhone}}</template>
                        <el-menu-item index="" style="padding: 10px;width: 200px;height: 190px;position:relative;background: #fff">
                            <a href="home.html"  style="width: 100%;height: 100%;display: block;">
                                <div>{{userInfo.name}}{{userInfo.phone}}</div>
                                <div style="overflow: hidden;">
                                    <div class="tab">我的课程</div>
                                    <div class="tab">我的收藏</div>
                                    <div class="tab">个人中心</div>
                                    <div class="tab">咨询记录</div>
                                </div>
                            </a>
                            <div style="position:relative;z-index: 100;top: -34px;left: 90px;">
                                <el-button type="primary" size="small" @click="loginOut">安全退出</el-button>
                            </div>
                        </el-menu-item>
                    </el-submenu>
                </el-menu>
                <a href="javascript:;" class="ml-30 mr-30" id="loginBtn" @click="showLogin" v-if="!userPhone">
                    <i class="login-ico"></i>登录
                </a>

                <a href="javascript:;" id="logoutBtn" @click="showRegister" v-if="!userPhone">
                    <i class="regin-ico"></i>注册
                </a>
            </div>
            <div class="clearBoth"></div>
        </div>
        <div class="clearBoth"></div>
    </div>
    <!-- 弹框 -->
    <el-dialog
            :title="title"
            :visible.sync="loginDialogVisible"
            :close-on-click-modal="false"
            width="400px"
            center>
        <div>
            <el-form :model="form" :rules="rules" ref="form" label-width="60px">
                <el-form-item label="手机号" prop="phone">
                    <el-input  v-model="form.phone" placeholder="请输入手机号" style="width: 300px;"></el-input>
                </el-form-item>
                <el-form-item label="密码" prop="password">
                    <el-input v-model="form.password" placeholder="请输入密码" style="width: 300px;"></el-input>
                </el-form-item>
            </el-form>
            <div style="text-align: right">
                <span @click="isLogin = false" v-if="isLogin" class="regisers">去注册</span>
            </div>
            <div style="text-align: right">
                <span @click="isLogin = true" v-if="!isLogin" class="regisers">去登录</span>
            </div>
        </div>
        <span slot="footer" class="dialog-footer"  v-if="isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'登录中':'登录'}}</el-button>
        </span>
        <span slot="footer" class="dialog-footer"  v-if="!isLogin">
            <el-button @click="loginDialogVisible = false">取 消</el-button>
            <el-button type="primary" :loading="loading" @click="submitCostomer('form')">{{loading?'注册中':'注册'}}</el-button>
        </span>
    </el-dialog>
    <!------------------------在线客服  / 回到顶部----------------------------------->
    <div class="tools">
        <div id="right-float" style="display:none;">
            <a href="/static/member/qjhy/index.html" target="_blank"><img src="static/picture/right-float.png"/></a>
        </div>
        <div style="height:36px;width:1px;margin-top:20px;margin-bottom:5px;">
            <div id="top" style="display: none;">
                <a href="javascript:;" style="margin-left:190px;margin-top:0px;"></a>
            </div>
        </div>
        <div id="help">
            <a href="https://xiaojuzi.shujet.com/visitor/chat" target="_blank"
               style="margin-left:190px;margin-top:0px;background: transparent"></a>
        </div>
    </div><!----------------新增面包屑导航--------------->
    <div class="breadCrumbs">
        <label>当前位置：</label>
        <a href="index.html" class="level" style="font-size: 14px;">课程首页</a>
        <span style="font-size: 14px;margin: 0px 5px;"> &gt; </span>
        <span class="level" style="font-size: 14px;">课程详情</span>
    </div>

    <!---------------课程详情头部----------------->
    <div class="class-pro">
        <div class="class-pro-box">
            <div class="imgBox" id="play-box">
                <!--            <img :src="{{courseDetailData.conten_url}}">-->
                <img :src="courseDetailData.conten_url">
                <div class="button-box">
                    <a onclick="OpenCourseChapter('6c984ce43899489daec80f861fc707b7')" class="course-chapter-view">课程章节</a>
                </div>
            </div>
            <div class="classPro">
                <h3 id="course-title">{{courseDetailData.title}}</h3>
                <div class="proList">
                <span style="padding-left: 0;"><i class="t-icon"></i><em class="mini">时长:</em> <span id="courseLength" style="padding: 0px;">
                    {{courseDetailData.time_count | pickTime}}
                </span>
                </span>
                    <em class="em">|</em>
                    <span><i class="re-icon"></i><em class="mini">报名:</em> {{courseDetailData.user_count}}人 </span><em class="em">|</em>
                    <span><i class="m-icon"></i><em class="mini">类型:</em>
					{{courseDetailData.level1_link?courseDetailData.level1_link.title:''}}
            </span>
                </div>
                <div style="height: 55px;overflow: hidden;" class="classText">
                    {{courseDetailData.brief_info}}
                </div>
                <p class="price-state" id="course-type" data-course-type="00">
                    <!--免费课程-->
                </p>
                <div class="play-btn-box">
                    <div class="aBtn study-btn">
                        <a href="javascript:void(0)" @click="study">开始学习</a>
                    </div>

                    <div style="clear: both;"></div>
                </div>

                <div class="share">
                    <div class="collect">
							<span>
							<a @click="shouCang"
                               href="javaScript:void(0)" name="">
           						<i class="iconfont icon-icon1"></i>加入收藏</a>
						</span>
                    </div>
                    <div class="share-tooltip">
                        <!--<span>-->
                        <!--<i class="iconfont icon-fenxiang"></i>-->
                        <!--<em>分享</em>-->
                        <!--</span>-->
                        <div class="bdsharebuttonbox">
                            <a href="#" class="bds_qzone" data-cmd="qzone" title="分享到QQ空间">QQ空间</a>
                            <a href="#" class="bds_tsina" data-cmd="tsina" title="分享到新浪微博">新浪微博</a>
                            <a href="#" class="bds_tqq" data-cmd="tqq" title="分享到腾讯微博">腾讯微博</a>
                            <a href="#" class="bds_renren" data-cmd="renren" title="分享到人人网">人人网</a>
                            <a href="#" class="bds_weixin" data-cmd="weixin" title="分享到微信">微信</a>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <!--------------------课程详细----------------------->
    <div class="proBox">
        <div class="ltPro">
            <div class="classTab">
                <ul>
                    <!-- class="cur" -->
                    <li>
                        <a id="evaId1" style="cursor: pointer;" onclick="searchType('01')">课程详情 </a>
                    </li>
                    <!--<li>-->
                    <!--<a id="evaId3" style="cursor: pointer;" onclick="searchType('03')">课程评价 </a>-->
                    <!--</li>-->
                    <!--<li>-->
                    <!--<a id="evaId4" style="cursor: pointer;" onclick="searchType('04')">课件下载 </a>-->
                    <!--</li>-->
                </ul>
            </div>
            <div class="content">
                <!---------------课程详情内容------------------->
                <div class="select kc-pro hide">
                    <div class="article">
                        <div class="course-panel">
                            <h3 class="panel-title">
                                <em></em>
                                课程简介
                            </h3>
                            <div class="panel-body" v-html="courseDetailData.details"></div>
                        </div>
                    </div>
                </div>
                <!---------------课程评论内容------------------->
                <div class="select kc-comment hide">
                    <ul class="evaluation-list" id="evaList">
                    </ul>
                    <!-----------------------分页--------------------------->
                    <div class="tcdPageCode" id="pageId"></div>

                    <div class="textarea" style="margin-top: 10px;">
                        <h1 align="left" style="font-size: 24px;color: #333;margin-bottom: 8px;">我要参评</h1>
                        <textarea id="evaluationContent" maxlength="300"></textarea>
                        <div class="btn">
                            <a onclick="addCourseEvaluation('6c984ce43899489daec80f861fc707b7','00')"
                               href="javaScript:void(0)">发表评论</a>
                        </div>
                    </div>
                </div>
                <!---------------课件下载内容------------------->
                <div class="select kc-down hide" style="padding: 0px 10px;margin-top: 3px;">
                    <div id="resourceList">

                    </div>
                    <!-----------------------分页--------------------------->
                    <div class="restcdPageCode" id="resourcePageId"></div>
                </div>
            </div>
        </div>

    </div>
    <!----------------------推荐课程--------------------------->
    <div class="recommendContent">
        <div class="kc-reco">
            <div class="titleTop">
                <h2>推荐课程</h2>
                <a href="study.html" class="more" title="查看更多">+</a>
            </div>
            <div class="class-all recommend">
                <ul style="display: flex;justify-content: space-between">
                    <li class="" v-for="(item,index) in contentData" :key="item.id">
                        <a :href="'coursedetail.html?id=' + item.id"  />
                        <div class="img-box">
                            <img :src="item.conten_url"/>
                        </div>
                        <h5 class="info">
                            <span class="p-title">{{item.title}}</span>
                        </h5>
                        <div class="tips">
                            <span>{{item.user_count}}人已学习</span>
                        </div>
                        </a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <!--------------------底部------------------->
    <div class="clearBoth"></div>
    <div class="footer">
        <div class="footer-box">
            <div class="service-nav lf">
                <dl>
                    <dt>帮助中心</dt>
                    <dd>
                        <a href="" target="_blank">如何注册</a>
                        <a href="" target="_blank">如何登陆</a>
                        <a href="" target="_blank">如何观看</a>
                    </dd>
                </dl>
                <dl>
                    <dt>服务支持</dt>
                    <dd>
                        <a href="" target="_blank">服务咨询</a>
                        <a href="" target="_blank">联系我们</a>
                        <!--<a href="" target="_blank">服务网点</a>-->
                    </dd>
                </dl>
                <dl>
                    <dt>办税链接</dt>
                    <dd>
                        <a href="https://12366.chinatax.gov.cn/bsfw/onlinetaxation/main" target="_blank">网上办税</a>
                        <a href="http://www.chinatax.gov.cn/" target="_blank">国家税务总局</a>
                        <a href="http://www.sccz.gov.cn/" target="_blank">四川省财政厅</a>
                    </dd>
                </dl>
            </div>

            <div class="help rt">
                <div class="help-phone">
                    <i class="d-icon"></i>
                    电话客服：<strong>400-6666-6666</strong>
                </div>
                <div class="huiyuan">
                    <i class="h-icon"></i>
                    会员专线：<strong>028-666666666</strong>
                </div>
                <!--			<div class="online">
                                <a href="" target="_blank">
                                    <i class="xinxi"></i>
                                    服务咨询
                                </a>
                            </div>-->
            </div>
            <div class="barcode rt">
                <img src="img/contact.png"/>
                <p>关注叮叮财税</p>
            </div>
        </div>
        <div class="footer-copy">
            <div class="a-box">
                <a href="">隐私条款</a> |
                <a href="">网站地图</a> |
                <a href="">版权声明</a>
            </div>
            <p>&copy;2018 成都东软学院@丁艳</p>
        </div>
    </div>
</div>
<script type="text/javascript">
    var _hmt = _hmt || [];
    (function () {
        var hm = document.createElement("script");
        hm.src = "https://hm.baidu.com/hm.js?a71c3d484b2419b0d94468789f7f49e1";
        var s = document.getElementsByTagName("script")[0];
        s.parentNode.insertBefore(hm, s);
    })();
</script>
<script type="text/javascript" src="static/js/trace.js"></script>
<script>
    (function () {
        this.trace('000000'); //需要传入参数 系统ID
    })();
</script>
<script type="text/javascript" src="static/js/jquery-1.11.0.min.js"></script>
<script type="text/javascript" src='static/js/polyvplayer.min.js'></script>
<script type="text/javascript" src="static/js/jquery.page.js"></script>
<script type="text/javascript" src="static/js/caishuib.js"></script>
<script type="text/javascript" src="static/js/layer.js"></script>
<script type="text/javascript" src="static/js/layui.js"></script>
<script type="text/javascript" src="static/js/aliplayer-min.js"></script>
<script type="text/javascript">



    $(function () {
        navClassSelect("#header-nav", "course", "current");
        $(".ltPro .select").first().show();
        $(".classTab li").first().addClass("cur");
        $(".classTab li").click(function () {
            var z = $(this).index();
            $(this).addClass("cur").siblings().removeClass("cur");
            $(".ltPro .select").eq(z).show().siblings(".select").hide();
        });
        //判断是否可试听
        judgeIsFreeTrial(courseId);
    });




</script>
<script>
    console.log(window.location.search);
    window._bd_share_config = {
        "common": {
            "bdSnsKey": {},
            "bdText": "",
            "bdMini": "2",
            "bdMiniList": false,
            "bdPic": "",
            "bdStyle": "0",
            "bdSize": "16"
        },
        "share": {
            "bdSize": 16
        }
    };
    with (document) 0[(getElementsByTagName('head')[0] || body).appendChild(createElement('script')).src = 'http://bdimg.share.baidu.com/static/api/js/share.js?v=89860593.js?cdnversion=' + ~(-new Date() / 36e5)];
</script>


</body>
<script type="text/javascript">
    var validatePass = (rule, value, callback) => {
        if (value === '') {
            callback(new Error('请输入密码'));
        } else {
            var r = /^[^\u4e00-\u9fa5]+$/
            if(!r.test(value)){
                callback(new Error('密码不能为中文!'));
            }
            if (value.length < 6 ) {
                callback(new Error('密码长度在 6 到 18 个字符!'));
            }
            callback();
        }
    };
    var phoneValid = (rule, value, callback) => {
        let phoneReg = /^(13[0-9]|14[579]|15[0-3,5-9]|16[6]|17[0135678]|18[0-9]|19[89])\d{8}$/
        if (!value) {
            callback(new Error('请输入手机号码'))
        }
        if (!phoneReg.test(value)) {
            callback(new Error('请输入正确的手机号码'))
        }
        callback()
    };
    new Vue({
        el: '#app',
        data: {
            title:'',
            form: {
                phone:'',
                password:''
            },
            rules: {
                phone: [
                    { validator: phoneValid, trigger: 'change' }
                ],
                password: [
                    { validator: validatePass, trigger: 'change' }
                ]
            },
            isLogin:true,
            loading:false,
            loginDialogVisible:false,
            courseDetailData: [],
            contentData: [],
            headData: [],
            shareData: [],
            shenData: [],
            caishuiData: [],
            token: '',
            isToLogin: false,
            phone: '',
            password: '',
            errText: '',
            userPhone:'',
            userInfo:{},
            loginHttp: 'http://xiaopengbest.cn/api/user/session',
            registerHttp: 'http://xiaopengbest.cn/api/user/session/register',
            courseDetailHttp: 'http://xiaopengbest.cn/api/express/course/',
            keHttp: 'http://xiaopengbest.cn/api/express/course?recommend=1',
            shouHttp: 'http://xiaopengbest.cn/api/user/collectCourse'

        },
        watch: {
            loginDialogVisible:function (val) {
                if (!val) {
                    Object.keys(this.form).forEach(key => this.form[key] = '');
                    this.$refs['form'].resetFields();
                }
            },
            isLogin:function (val) {
                if (val) {
                    this.title='登录';
                } else{
                    this.title='注册';
                }
            }
        },
        created() {
            this.courseDetailHttp = this.courseDetailHttp + this.GetRequest('id');
            this.token = localStorage.getItem('token');
            if(this.token){
                this.token =(this.token.replace('"',''));
            }
            this.userPhone = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')).phone:'';
            this.userInfo = localStorage.getItem('userInfo')?JSON.parse(localStorage.getItem('userInfo')):'';
            this.getCourseDetailList();
            this.getKcList();
        },
        mounted() {

        },
        methods: {
            loginOut() {
                localStorage.clear();
                // window.location.href = 'http://xiaopengbest.cn/index.html';
                window.location.reload();
            },
            showLogin() {
                this.title='登录';
                this.isLogin = true;
                this.loginDialogVisible = true;
            },
            showRegister() {
                this.title='注册';
                this.isLogin = false;
                this.loginDialogVisible = true;
            },
            submitCostomer(formName) {
                this.$refs[formName].validate((valid) => {
                    if (valid) {
                        if (this.isLogin){
                            this.toLogin();
                        } else {
                            this.toRegister();
                        }
                    } else {
                        return false;
                    }
                });
            },
            toLogin() {
                this.loading = true;
                axios.post(this.loginHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'登录成功',
                            duration:1000
                        });
                        this.loginDialogVisible = false;
                        this.userPhone = res.data.data.phone;
                        localStorage.setItem('userInfo', JSON.stringify(res.data.data));
                        localStorage.setItem('token', JSON.stringify(res.data.data.api_token));
                        window.location.reload();
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            toRegister() {
                this.loading = true;
                axios.post(this.registerHttp, {
                    phone: this.form.phone,
                    password:this.form.password
                }).then((res) => {
                    if (res.data.code == 200) {
                        this.loading = false;
                        this.$message({
                            type:'success',
                            message:'注册成功,去登陆',
                            duration:1000
                        });
                        this.isLogin = true;
                    }
                }).catch((err)=> {
                    this.loading = false;
                    this.$message.warning(err.response.data.msg || "数据异常，请重试");
                });
            },
            study() {
                if (!this.token) {
                    this.title='登录';
                    this.loginDialogVisible = true;
                } else {
                    window.location.href = 'http://xiaopengbest.cn/videoplay.html?id=' + this.GetRequest('id');
                    // window.location.href = 'http://localhost:63342/dingding-pc/videoplay.html?id=' + this.GetRequest('id');
                }
            },
            shouCang() {
                if (!this.token) {
                    this.title='登录';
                    this.loginDialogVisible = true;
                } else {
                    axios.post(this.shouHttp, {
                                course_id: this.GetRequest('id')
                            },
                            {
                                headers: {
                                    "Content-Type": "application/x-www-form-urlencoded;charset=utf-8",
                                    'Authorization': 'Bearer ' + this.token
                                },
                                transformRequest: [function (data) {
                                    let ret = '';
                                    for (let it in data) {
                                        ret += encodeURIComponent(it) + '=' + encodeURIComponent(data[it]) + '&'
                                    }
                                    return ret
                                }]
                            }
                    )
                            .then( (res)=> {
                                if(res.data.code == 200) {
                                    this.$message({
                                        message:res.data.msg,
                                        type:'success',
                                        duration:1000
                                    });
                                } else {
                                    this.$message({
                                        message:res.data.msg,
                                        type:'warning',
                                        duration:1000
                                    });
                                }
                            }).catch( (err)=> {
                        // this.$message.warning(err.response.data.msg || "数据异常，请重试");
                        console.log(err.response);
                        this.$message({
                            message:err.response.data.msg,
                            type:'warning',
                            duration: 1000
                        });
                    });
                }

            },
            GetRequest(value) {
                let url = decodeURI(location.search);
                let object = {};
                if(url.indexOf("?") != -1)
                {
                    let str = url.substr(1);
                    let strs = str.split("&");
                    for(let i = 0; i < strs.length; i ++)
                    {
                        object[strs[i].split("=")[0]]=strs[i].split("=")[1]
                    }
                }
                return object[value];
            },
            getCourseDetailList() {
                const self = this;
                axios.get(this.courseDetailHttp, {
                            headers: {
                                "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                                // 'Authorization': 'Bearer ' + this.token,
                            }
                        }
                )
                        .then(function (res) {
                            self.courseDetailData = res.data.data;
                        }).catch(function (res) {
                    console.log(res);
                });
            },
            getKcList() {
                const self = this;
                axios.get(this.keHttp, {
                            headers: {
                                "Content-Type": "application/x-www-form-urlencoded;charset=utf-8"
                                // 'Authorization': 'Bearer ' + this.token,
                            }
                        }
                )
                        .then(function (res) {
                            self.contentData = res.data.data;
                        }).catch(function (res) {
                    console.log(res);
                });
            },

        },
        filters: {
            pickTime(val) {
                if (val) {
                    var day=parseInt(val/60/24);
                    var hour=parseInt(val/60%24);
                    var min= parseInt(val % 60);
                    StatusMinute="";
                    if (day > 0)
                    {
                        StatusMinute= day + "天";
                    }
                    if (hour>0)
                    {
                        StatusMinute += hour + "小时";
                    }
                    if (min>0)
                    {
                        StatusMinute += parseFloat(min) + "分钟";
                    }
                    return StatusMinute;
                }
            }
        },
    });

</script>
</html>
